(function($) {
	//记录列表处理JS类
	var ListForm 	= {
		init: function() {
			this.bindListFormSubmit();
			HHJsLib.bindLightBox('#record_list_area_id a.list-img');
		},
		bindListFormSubmit: function() {
			$("#exec_operation_id").click(function() {
				try {
					ListForm.validate();
					$("#list_form_id").submit();
				} catch(e) {
					alert(e);
				}
			});
		},
		validate: function() {
			var selectedRecords 	= 0;
			$("#record_list_area_id input:checkbox").each(function() {
				if($(this).attr("checked")) {
					selectedRecords ++;
					return true;
				}
			});
			if(0 == selectedRecords) {
				throw "请选择需要操作的记录!";
			}
			if(!$("#operation_id").val()) {
				$("#operation_id").focus();
				throw "请选择操作项";
			}
		}
	};
	HHJsLib.register(ListForm, ListForm.init, "init");
})(jQuery);